﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BlackBird.DataAccess;
using BlackBird.ControllerHelpers;
using BlackBird.Models;

namespace BlackBird.Controllers
{
    [Authorize]
	public partial class HomeController : Controller
	{
		
		public virtual ActionResult Index()
		{
			string id = AccountHelper.GetCurrentUserId(this);
			var user = AccountDataAccess.GetUserInfoByUserID(id);
			AccountHelper.AddAccountInfo(this, user);
			ViewBag.Message = "项目视图页";

			var allProject = GlobalObjectBuffer.AllProjects;

			//当前用户需要处理的比价单
			allProject.MessageDM = ProjectHelper.GetCurrentUserMessagePopupDM(user);

            var IsEnableToCreateBijiadan = QuanXianAndProcessHelper.IsEnableToCreateBijiadan(this);
            ViewData["IsEnableToCreateBijiadan"] = IsEnableToCreateBijiadan;

            var IsEnableToCreateFuKuandan = QuanXianAndProcessHelper.IsEnableToCreateFuKuandan(this);
            ViewData["IsEnableToCreateFuKuandan"] = IsEnableToCreateFuKuandan;
			return View(allProject);
		}

		public virtual ActionResult About()
		{
			return View();
		}
	}
}
